import Vue from 'vue'
import Router from 'vue-router'
import app from '@/App'
import bindex from '@/views/index/index'
import empty from '@/views/index/empty'

import persion from '@/views/personal/person'
import videoplay from "@/views/video/videoplay";
import message from "@/views/message/message";
import history from "@/views/history/history";
import upload from "@/views/upload/upload";
import uploadvideo from "@/views/upload/uploadvideo";
import uploadarticle from "@/views/upload/uploadarticle";
import uploadmanage from "@/views/upload/uploadmanage";
import uploadmanagevideo from "@/views/upload/uploadmanagevideo";
import uploadmanagearticle from "@/views/upload/uploadmanagearticle";
import pindao from "@/views/pindao/pindao";
import dongtai from "@/views/dongtai/dongtai";
import login from "@/views/login/login";
import register from "@/views/login/register";
import findpwd from "@/views/login/findpwd";
import zhuye from '@/views/personal/zhuye';
import likeandfans from '@/views/personal/likeandfans';
import guanzhu from '@/views/personal/guanzhu';
import fans from '@/views/personal/fans';
import tougao from '@/views/personal/tougao';
import shoucang from '@/views/personal/shoucang';
import zan from '@/views/message/zan';
import response from '@/views/message/response';
import mymsg from '@/views/message/mymsg';
import zhuanlan from '@/views/zhuanlan/zhuanlan';
import zhuanlandetail from '@/views/zhuanlan/zhuanlandetail';
import zhuanlanconcent from '@/views/zhuanlan/zhuanlanconcent';
import search from '@/views/search/search';

import manage from '@/views/manage/manage';
import updateUser from '@/views/manage/updateUser';
import articlemanage from '@/views/manage/articlemanage';
import partionmanage from '@/views/manage/partionmanage';
import usermanage from '@/views/manage/usermanage';
import videomanage from '@/views/manage/videomanage';
import pindaomanage from '@/views/manage/pindaomanage';
Vue.use(Router)

export default new Router({
  mode: "history",
  routes: [
    {
      path: '/manage',
      component: manage,
      children: [
        { path: "", component: usermanage },
        { path: "usermanage", component: usermanage },
        { path: "articlemanage", component: articlemanage },
        { path: "partionmanage", component: partionmanage },
        { path: "pindaomanage", component: pindaomanage },
        { path: "updateUser/:userId", component: updateUser },
        { path: "videomanage", component: videomanage }
      ],
    },
    {
      path: '/bindex',
      component: bindex
    },
    {
      path: '/empty',
      component: empty
    },
    {
      path: '/',
      component: bindex
    },
    {
      path: '/zhuanlan',
      component: zhuanlan, children: [
        { path: '', component: zhuanlanconcent },
        {
          path: 'zhuanlanconcent/:code',name:'zhuanlanconcent', component: zhuanlanconcent
        }]
    },
    {
      path: '/zhuanlandetail',
      component: zhuanlandetail
    },
    {
      path: '/findpwd',
      component: findpwd
    },
    {
      path: '/register',
      component: register
    },
    {
      path: '/dongtai',
      component: dongtai
    },
    {
      path: '/login',
      component: login
    },
    {
      path: '/pindao/:partId',
      component: pindao
    },
    {
      path: '/upload',
      component: upload,
      children: [
        { path: "", component: uploadvideo },
        { path: "uploadvideo", component: uploadvideo },
        { path: "uploadarticle", component: uploadarticle }],
    },
    {
      path: '/history',
      component: history
    },
    {
      path: '/message',
      component: message,
      children: [
        { path: 'mymsg', component: mymsg },
        { path: 'zan', component: zan },
        { path: 'response', component: response },
        { path: '', component: response },
      ]
    },
    {
      path: '/app',
      name: 'app',
      component: app
    },
    {
      path: '/uploadmanage',
      component: uploadmanage, children: [{
        path: '', component: uploadmanagevideo
      },
      {
        path: 'uploadmanagevideo', component: uploadmanagevideo
      },
      {
        path: 'uploadmanagearticle', component: uploadmanagearticle
      },
      ]
    },

    {
      path: '/person',
      name: 'person',
      component: persion,
      children: [{ path: "zhuye/:userId", component: zhuye },
      { path: "", component: zhuye },
      { path: "shoucang/:userId", component: shoucang },
      { path: "tougao/:userId", component: tougao },		//嵌套路由
      {
        path: "likeandfans/:userId",
        component: likeandfans,
        children: [
          { path: "guanzhu", component: guanzhu },
          { path: "fans", component: fans },]
      },

      ]
    },
    {
      path: '/videoplay/:videoId',
      name: 'videoplay',
      component: videoplay,
    },
    {
      path: '/search/:videoTitle',
      name: 'search',
      component: search,
    },
  ]
})
